<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Wikey.Entity.Page>" %>
<%@ Import Namespace="Wikey.Transformation"%>

<p class="PageDescription">
  <%= ViewData.Model.Description%>
</p>


<% var jsBuilder = new StringBuilder(); %>
<ul id="PageContent">
<% foreach( var content in ViewData.Model.PageContentNodes) { %>
<li>
<div id="<%=String.Format("pcd-{0}", content.ContentNode.Id)%>" class="content" >
  <% var transformResults = new Transform().Do(content.ContentNode.Text, jsBuilder); %>
  <%= transformResults.Html %>
</div>
</li>
<% } %>
</ul>

<script type="text/javascript">
  var resultJs = "<%= jsBuilder.ToString() %>";
  
  eval( resultJs ) ;
</script>